{html_script src="WhiteLabel.Breadcrumb.js"}
{html_script url=$Scripts}

<style type="text/css">
    {literal}
        #inscripcion ul{
            list-style-type: none;
        }
    {/literal}
</style>

{function name="printFormularios" fields="" title=""}
    <fieldset>
        {if not empty($title)}<legend>{$title}</legend>{/if}
        {foreach $fields as $field}
            {if is_array($field)}
                {call name="printFormularios" fields=$field title=$field@key}
            {else}
                {$tipo = $field->getTipo()}
                <input type="hidden" name="Names[{$field->getId()}]" value="{$field->getNombreCampo()}"/>
                <dl>
                    {render_label q=$field}
                    <div>
                    {render_control q=$field}
                    </div>
                </dl>
            {/if}
        {/foreach}
    </fieldset>
{/function}

{function name="printFormularioTabs" fields=""}
    {call name="createBreadCrumbHead" fields=$fields}
    <div id="FormContent">
    {foreach $fields as $fieldset}
        <div id="{$fieldset@key|replace:" ":""}">
            {call name="printFormularios" fields=$fieldset}
            {if $fieldset@iteration != 1}
                <button class="prev">Anterior</button>
            {/if}
            {if not $fieldset@last}
            <button class="next">Siguiente</button>
            {else}
             <button class="icon i_cassette" type="submit">Enviar Inscripci&oacute;n</button>
            {/if}
        </div>
    {/foreach}
    </div>
{/function}

{function name="createBreadCrumbHead" fields=""}
    <ul class="breadcrumb" data-connect="FormContent">
    {foreach $fields as $fieldset}
        <li><a href="#{$fieldset@key|replace:" ":""}">{$fieldset@key}</a></li>
    {/foreach}
    </ul>
{/function}

<form id="inscripcion" action="{$Action}" method="post" class="form-validate">
    <input type="hidden" name="check" value="post"/>
    <input type="hidden" name="destination" value="{$Destino}"/>
    {if $UseTabs}
        {call name="printFormularioTabs" fields=$Tree}
    {else}
        {call name="printFormularios" fields=$Tree title=""}
        <dl>
            <div>
                <button class="icon i_cassette" type="submit">Enviar Inscripci&oacute;n</button>
            </div>
        </dl>
    {/if}
</form>